﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Logged.Master" CodeBehind="Log.aspx.vb" Inherits="giarsweb.Log" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="Menu_ContentPlaceHolder" runat="server">
    <ul id="menu" class="blue">
	    <li ><a href="AccessRecords.aspx" >Access Records</a></li>
        <li class="active"><a href="Log.aspx" >Log</a></li>
	    <li ><a href="Passes.aspx">Passes</a></li>
	    <li ><a href="Customers.aspx">Customers</a></li>
	    <li ><a href="Users.aspx">Users</a></li>
        <li ><a href="About.aspx">About</a></li>
    </ul>
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <h2>GIARS Log</h2>
    </div>
    <div class="grouped">
        <fieldset class="groupbox">
            <legend >Filters</legend>
            <asp:Table ID="Table1" runat="server" Width="613px">
                <asp:TableRow ID="TableRow1" runat="server">
                    <asp:TableCell ID="TableCell1" runat="server" >
                        <img id="ajax_loading_img" 
                             src="Images/AjaxLoading.gif" 
                             alt="" title="Loading" 
                             style="display: none; height: 20px; width: 20px" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow runat="server">
                    <asp:TableCell runat="server" ><asp:Label ID="Label1" runat="server" Text="Customer: " ></asp:Label></asp:TableCell>
                    <asp:TableCell runat="server" >
                        <asp:HiddenField ID="hdCustID" runat="server" />
                        <asp:TextBox ID="customer_TextBox" runat="server" Width="250px" autocomplete="off"></asp:TextBox>
                        <script type="text/javascript">
                            function customer_TextBox_OnClientPopulating(sender, e) {
                                //Before starting ajax request
                                var loadingdiv = document.getElementById('ajax_loading_img');
                                loadingdiv.style.display = "block";
                            }
                            function customer_TextBox_OnClientCompleted(sender, e) {
                                //after the ajax request is complete
                                var loadingdiv = document.getElementById('ajax_loading_img');
                                loadingdiv.style.display = "none";
                            }
                            function customer_TextBox_itemSelected(sender, e) {
                                var hdCustID = $get('<%= hdCustID.ClientID %>');
                                hdCustID.value = e.get_value();
                            }
                        </script>
                        <ajaxToolkit:AutoCompleteExtender 
                            ID="customer_TextBox_AutoCompleteExtender" 
                                CompletionSetCount="20"
                                MinimumPrefixLength="1"
                                runat="server" 
                                DelimiterCharacters="" 
                                Enabled="True" 
                                ServicePath="Log.aspx" 
                                TargetControlID="customer_TextBox" 
                                UseContextKey="True" 
                                ServiceMethod="GetCustomerCompletionList" 
                                OnClientItemSelected="customer_TextBox_itemSelected"
                                OnClientHiding="customer_TextBox_OnClientCompleted"
                                OnClientPopulated="customer_TextBox_OnClientCompleted" 
                                OnClientPopulating="customer_TextBox_OnClientPopulating">
                        </ajaxToolkit:AutoCompleteExtender>
                    </asp:TableCell>
                    <asp:TableCell runat="server" ></asp:TableCell></asp:TableRow>
                <asp:TableRow runat="server">
                    <asp:TableCell runat="server" ><asp:Label ID="Label2" runat="server" Text="Date From-To: "></asp:Label></asp:TableCell>
                    <asp:TableCell runat="server" ><asp:TextBox ID="fromDate_TextBox" runat="server" Width="250px"></asp:TextBox><ajaxToolkit:CalendarExtender ID="fromDate_TextBox_CalendarExtender" runat="server" Enabled="True" TargetControlID="fromDate_TextBox"></ajaxToolkit:CalendarExtender></asp:TableCell>
                    <asp:TableCell runat="server" ><asp:TextBox ID="toDate_TextBox" runat="server" Width="250px"></asp:TextBox><ajaxToolkit:CalendarExtender ID="toDate_TextBox_CalendarExtender" runat="server" Enabled="True" TargetControlID="toDate_TextBox"></ajaxToolkit:CalendarExtender></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow runat="server">
                    <asp:TableCell runat="server" ></asp:TableCell>
                    <asp:TableCell runat="server" >
                        <asp:Button ID="filter_Button" runat="server" Text="Filter" Width="90px" />
                    </asp:TableCell>
                    <asp:TableCell runat="server" ></asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </fieldset>
    </div>

    <div class="grouped">
        <fieldset class="groupbox">
            <legend >Log</legend>
  <%--          
            <br />--%>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
            
                <ContentTemplate>

                    <asp:Label ID="info_Label" runat="server" Text="" class="infoMsgText"></asp:Label>

                    <asp:GridView 
                        ID="accessRecords_GridView" 
                        runat="server" 
                        AlternatingRowStyle-CssClass="GridViewAlternatingRowStyle" 
                        AutoGenerateColumns="False" 
                        HeaderStyle-CssClass="GridViewHeaderStyle" 
                        RowStyle-CssClass="GridViewRowStyle" Width="100%">
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <Columns>
                            <asp:BoundField DataField="Id" HeaderText="Id" Visible="False" />
                            <asp:BoundField DataField="PassSerialNumber" HeaderText="PassSerialNumber" />
                            <asp:BoundField DataField="CustomerIdNumber" HeaderText="CustomerIdNumber" />
                            <asp:BoundField DataField="CustomerName" HeaderText="CustomerName" />
                            <asp:BoundField DataField="CustomerPhone" HeaderText="CustomerPhone" />
                            <asp:BoundField DataField="IssuedPassNo" HeaderText="IssuedPassNo" />
                            <asp:BoundField DataField="AuthorizedByUser" HeaderText="AuthorizedByUser" />
                            <asp:BoundField DataField="IssuedByUser" HeaderText="IssuedByUser" />
                            <asp:BoundField DataField="IssuedDate" HeaderText="IssuedDate" />
                            <asp:BoundField DataField="Purpose" HeaderText="Purpose" />
                            <asp:BoundField DataField="RetrievedByUser" HeaderText="RetrievedByUser" />
                            <asp:BoundField DataField="RetrievedDate" HeaderText="RetrievedDate" />
                            <asp:BoundField DataField="Status" HeaderText="Status" />
                        </Columns>
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                    </asp:GridView>

                </ContentTemplate>

                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="filter_Button" EventName="Click" />
                </Triggers>

            </asp:UpdatePanel>
            <br />

            <br />
            <br />
        </fieldset>
    </div>
    <br />
    <br />
</asp:Content>
